package Practice04;

public class test3 {
    public static void main(String[] args) {

        String str1="A String";
        String str2="A String";
        String str3=str1;       //常量池中地址相同

        System.out.println(str1==str2);
        System.out.println(str1==str3);
        System.out.println(str1.length());
        System.out.println(str1.equals(str2));
        System.out.println(str1.equals(str3));
        System.out.println(str1.compareTo (str2));
        System.out.println(str1.compareTo (str3));
        System.out.println(str1.concat(str3));
        System.out.println(str1.indexOf('t'));
        System.out.println(str3.lastIndexOf('t'));
        System.out.println(str1.indexOf("t"));
        System.out.println(str1.substring(2,4));
    }
}
